home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / SHARE / prog / POVRAY / SPIKES-1.ZIP / SPIKES-1.POV
Encoding:
Text File  |  1996-04-24  |  6.1 KB  |  167 lines

  1.  
  2. //------------------------------------------------------------------>
  3. // Spikes-1.Pov - A few groups of random spikes.
  4. //
  5. // Free demonstration file by: Paul T. Dawson.
  6. //                             ptdawson@voicenet.com
  7. //
  8. // For the magnificent raytracer, POV-Ray 3.0 (Thank You, POV-Team!).
  9. //
  10. // This scene uses the new POV-Ray 3.0 beta 6 "rand" function.
  11.  
  12. //------------------------------------------------------------------>
  13. // Standard settings and include files.
  14.  
  15.         #version 3.0
  16.         global_settings { assumed_gamma 2.2 }
  17.  
  18.         #include "colors.inc"
  19.         #include "textures.inc"
  20.         #include "glass.inc"
  21.         #include "golds.inc"
  22.         #include "skies.inc"
  23.  
  24. //------------------------------------------------------------------>
  25. // Set up the camera and (too many?) lights.
  26.  
  27.         camera { location < 0, 0, -35 > look_at < 0, 0, 0 > }
  28.  
  29.         light_source { < -99, 99,   0 > color White }
  30.         light_source { <   0, 99, -99 > color White }
  31.         light_source { <  99, 99,   0 > color White }
  32.         light_source { <   0, -9, -99 > color White }
  33.  
  34. //------------------------------------------------------------------>
  35. // Put in a fantastic sky (POV-Team did all the work!).
  36.  
  37.         sky_sphere { S_Cloud1 }
  38.  
  39. //------------------------------------------------------------------>
  40. // Add a relatively simple floor. The glass floor is semi-transparent,
  41. // so the white sub-floor brightens it up a little.
  42.  
  43.         cylinder { <0, -21, 0 > < 0, -22, 0 >, 9999
  44.                 texture { T_Green_Glass }
  45.                 normal { bumps 3 scale 3 } }
  46.  
  47.         cylinder { <0, -31, 0 > < 0, -32, 0 >, 9999
  48.                 pigment { White } }
  49.  
  50. //------------------------------------------------------------------>
  51. // Start the pseudo-random number sequence. The random numbers are
  52. // used to rotate the cones.
  53.  
  54.         #declare R1 = seed(1)
  55.  
  56. //------------------------------------------------------------------>
  57. // Create the Spike object.
  58.  
  59.         #declare Number_Of_Cones = 300
  60.  
  61.         #declare Spike = union {
  62.  
  63.                 #declare LOOP = 0
  64.                 #while ( LOOP < Number_Of_Cones )
  65.  
  66.                 // Get the random numbers for rotating this cone.
  67.                 #declare X1 = rand ( R1 ) * 359
  68.                 #declare Y1 = rand ( R1 ) * 359
  69.                 #declare Z1 = rand ( R1 ) * 359
  70.  
  71.                 // These lines are for checking the random numbers.
  72.                 // Un-comment them if you're really curious!
  73.                 //#debug concat(" X1 =",str(X1,8,3))
  74.                 //#debug concat("   -   Y1 =",str(Y1,8,3))
  75.                 //#debug concat("   -   Z1 =",str(Z1,8,3),"\n")
  76.  
  77.                 cone { < 0, 0, 0 >, 1 < 0, 12, 0 >, 0
  78.                         rotate < X1, Y1, Z1 >
  79.                         } // End of cone.
  80.  
  81.                 #declare LOOP = LOOP + 1
  82.                 #end
  83.  
  84.                 finish { Shiny }
  85.  
  86.         } // End of union.
  87.  
  88. //------------------------------------------------------------------>
  89. // Show one big Spike object in the center.
  90.  
  91.         object { Spike
  92.  
  93.                 pigment { White }
  94.  
  95.                 // Move it down a little.
  96.                 translate y * -1
  97.  
  98.                 } // End of object.
  99.  
  100. //------------------------------------------------------------------>
  101. // Now show twelve little ones orbiting around the center.
  102.  
  103.         #declare Color_Flag = 1
  104.  
  105.         #declare LOOP = 0
  106.         #while ( LOOP < 360 )
  107.  
  108.                 object { Spike scale 0.3
  109.  
  110.                         // Rotate it before you move it.
  111.                         rotate < rand(R1), rand(R1), rand(R1) >
  112.  
  113.                         // Move over to prepare for y rotation.
  114.                         translate x * 16
  115.  
  116.                         // Swing it around in a flat circle. Add 15 to
  117.                         // shift everything around a little.
  118.                         rotate y * -1 * ( LOOP + 15 )
  119.  
  120.                         // This tilts the set towards the camera.
  121.                         rotate x * -55
  122.  
  123.                         // Move it up a little.
  124.                         translate y * 4
  125.  
  126.                         // The orbiting groups are done in twelve colors.
  127.                         // This jumble of statements controls the colors!
  128.  
  129.                         // Yes, there's a simpler way to do this, but
  130.                         // this way is slightly easier for humans to read!
  131.  
  132.                         #if ( Color_Flag = 1 )
  133.                                 pigment { color rgb < 0.5, 0,   1   > } #end
  134.                         #if ( Color_Flag = 2 )
  135.                                 pigment { color rgb < 0,   0,   1   > } #end
  136.                         #if ( Color_Flag = 3 )
  137.                                 pigment { color rgb < 0,   0.5, 1   > } #end
  138.                         #if ( Color_Flag = 4 )
  139.                                 pigment { color rgb < 0,   1,   1   > } #end
  140.                         #if ( Color_Flag = 5 )
  141.                                 pigment { color rgb < 0,   1,   0.5 > } #end
  142.                         #if ( Color_Flag = 6 )
  143.                                 pigment { color rgb < 0,   1,   0   > } #end
  144.                         #if ( Color_Flag = 7 )
  145.                                 pigment { color rgb < 0.5, 1,   0   > } #end
  146.                         #if ( Color_Flag = 8 )
  147.                                 pigment { color rgb < 1,   1,   0   > } #end
  148.                         #if ( Color_Flag = 9 )
  149.                                 pigment { color rgb < 1,   0.5, 0   > } #end
  150.                         #if ( Color_Flag = 10 )
  151.                                 pigment { color rgb < 1,   0,   0   > } #end
  152.                         #if ( Color_Flag = 11 )
  153.                                 pigment { color rgb < 1,   0,   0.5 > } #end
  154.                         #if ( Color_Flag = 12 )
  155.                                 pigment { color rgb < 1,   0,   1   > } #end
  156.  
  157.                         #declare Color_Flag = Color_Flag + 1
  158.  
  159.                         } // End of object.
  160.  
  161.         #declare LOOP = LOOP + 30
  162.         #end
  163.  
  164. //------------------------------------------------------------------>
  165. // End of this file.
  166.  
  167.